<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 


<script>
function expand(n,speed){
	var up = "1318497647_br_up.png";
	var down = "1318497647_br_down.png";	
	var icon = n == 1 ? down : up;
	var fn = n == 1 ? "2" : "1";	
	var img = "<img src='${appPath }/resource/image/"+icon+"' style='cursor: pointer;' onclick='expand("+fn+",\"slow\");'/>";	
	if(n == 1){
		$("#area").slideUp(speed,function(){
			$("#slide_icon").html(img);
			$("#expandDescTd").html("展開查詢");			
			$("#expandDescTable").bind("click", function() {
				expand(2,"slow");
			}).css("cursor","pointer");
	 	});
	}else{
		$("#expandDescTd").html("");
		$("#expandDescTable").unbind("click").css("cursor","default");
		$("#area").slideDown("slow",function(){
			$("#slide_icon").html(img);
	 	});
	}
}

function checkall(n){
	$("#QueryAAFForm input[name='"+n+"']").each(function(){
		$(this).prop("checked", $('#'+n+'_all').prop("checked"));
	});		
}

function chgRowPerPage(n){
	$("#ChgRowPerPageLoadingImg").show();
	$('#QueryAAFForm2 input[name=rowsPerPage]').val(n);
	pageTo(1);
}

function pageTo(n){	
	$("#QueryAAFForm2 input[name=requery]").val("false");
	$("#nowPage").val(n);
	$.post("${appPath}/form/query.htm",$('#QueryAAFForm2').serialize(),function(data){
		$("#list").html(data);
		$("#ChgRowPerPageLoadingImg").hide();
	});
}

function _query(){
	showMessage("",7);
	var bolenArray = new Array();
	$("#div_qr span").each(function(){
		bolenArray[bolenArray.length] = this.className.replace(/_2/i,"");
		//bolenArray[bolenArray.length] = this.className;
	});	
	$('#QueryAAFForm input[name=qr_boolean]').val(bolenArray);
	$("#query_type").val("0");
	
	$.post("${appPath}/form/query.htm",$('#QueryAAFForm').serialize(),function(data){
		$("#list").html(data);
		expand(1,"");
		$("#DIS_ROWPERPAGE").show();
		hideMessage("fast");
	});
}

function _recquery(){
	$("#query_type").val("1");
	
	$.post("${appPath}/form/query.htm",$('#QueryAAFForm').serialize(),function(data){
		$("#list").html(data);
		expand(1,"");
		$("#DIS_ROWPERPAGE").show();
	});
}

function _reset(){
	document.getElementById("QueryAAFForm").reset();
	$("#span_selectedCodePlants").html("");
	$("#span_selectedCodeCountries").html("");	
	$("#div_qr").html('<input type="text" style="width:90%;" name="qr" class="qr" id="qr_1"/>');
	_len = 0;
	_width = 0;	
}

</script>
<div id="page">
	<div id="page-bgtop">
		<div id="page-bgbtm">
			<div id="content">
				<div class="post">
				<!--  
					<h2 class="title inner">表單查詢</h2>
					
					<div style="clear: both;">&nbsp;</div>
				-->
					<div class="entry">
						<div id="querylist">
							<%@ include file="form.jsp" %>							
															
							<div id="list"></div>
						</div>
						<div id="view"></div>
					</div>
				</div>
				<div style="clear: both;">&nbsp;</div>
			</div>
			<!-- end #content -->			
			<%@ include file="/WEB-INF/jsp/common/submenu02.jsp" %>			
			<div style="clear: both;">&nbsp;</div>
		</div>
	</div>
</div>




<div id="info1Overlay" class="overlay" style="display:none;">
	<div id="SubInfo1Overlay2" align="center" style="padding-top:150px;">	
		<div style="width:600px">
			<b class="b1f"></b><b class="b2f archead"></b><b class="b3f archead"></b><b class="b4f archead"></b>
			<div class="archead" style="padding-top:5px;padding-bottom: 5px;font-size: 12px;letter-spacing: 3px;">
				<img src="${appPath }/resource/image/1320847230_information.png" />&nbsp;&nbsp;
				資料編號查詢說明
			</div>
			<div class="arccontent arccontentBox" style="padding-left:20px;padding-right:20px;color: green;font-weight: 400;letter-spacing: 2px;text-align: left;">
				<table style="width:100%;">
					<tr>
						<td style="width:10px;" valign="top">1.</td>
						<td style="">
							逗號( , )查詢,可用於查詢多筆資料。
							例：<span style="background-color: #D5EAEA;padding: 2px 4px 2px 4px;color:#3B5998;">1,3,5,7,9</span>
						</td>
					</tr>
					<tr>
						<td style="width:10px;" valign="top">2.</td>
						<td style="">
							連接號( - )查詢,可用於查詢連續資料。
							例：<span style="background-color: #D5EAEA;padding: 2px 4px 2px 4px;color:#3B5998;">1-20</span>
						</td>
					</tr>
					<tr>
						<td style="width:10px;" valign="top">3.</td>
						<td style="">
							混合查詢。
							例：<span style="background-color: #D5EAEA;padding: 2px 4px 2px 4px;color:#3B5998;">1-20,34,36,40-45</span>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="padding-top:20px;padding-bottom: 10px;">
							<div style="background-color: #3B5998;text-align: center;letter-spacing: 4px;color: white;cursor: pointer;" onclick="$('#info1Overlay').fadeOut('fast')">
								關閉
							</div>
						</td>
					</tr>
				</table>
			</div>
			<b class="b4f"></b><b class="b3f"></b><b class="b2f"></b><b class="b1f"></b>
		</div>
	</div>
</div>
<!-- end #page -->